package com.uphone.mvpdemo.pro.activity.login;


import android.view.View;

import com.radish.baselibrary.Intent.IntentUtils;
import com.uphone.mvpdemo.MainActivity;
import com.uphone.mvpdemo.R;
import com.uphone.mvpdemo.base.mvp.BaseMvpActivity;

import butterknife.OnClick;
import okhttp3.ResponseBody;

/**
 * Created by hzy on 2019/1/18
 * LoginActivity  登录界面
 *
 * @author hzy
 */
public class LoginActivity extends BaseMvpActivity<LoginPresenter> implements LoginContract.View {


    @Override
    protected void initInject() {
        getActivityComponent().inject(this);
    }

    @OnClick({R.id.bt_login})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.bt_login:
                mPresenter.postLogin("15703379121", "123456");
                break;
            default:
                break;
        }
    }

    @Override
    public void updateView(String responseBean, int status) {
        if (status == 1) {
            IntentUtils.getInstance()
                    .with(this, MainActivity.class)
                    .start();
            finish();
        }
    }

    @Override
    protected void initBundle() {

    }

    @Override
    protected int initLayout() {
        return R.layout.activity_login;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initTitle() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initListener() {

    }
}
